const path = require("path");

function resolve(dir) {
  return path.join(__dirname, "./", dir);
}

module.exports = {
  publicPath: "./",
  productionSourceMap: false,
  lintOnSave: false,

  chainWebpack: (config) => {
    // Web标题 htmlWebpackPlugin.options.title
    config.plugin("html").tap((args) => {
      args[0].title = "地理实体数据更新维护及自然资源实体数据生产";
      return args;
    });
    // 为src下文件配别名，不使用相对路径
    config.resolve.alias
      .set("@", resolve("src"))
      .set("@assets", resolve("src/assets"))
      .set("@components", resolve("src/components"))
      .set("@views", resolve("src/views"))
      .set("@router", resolve("src/router"))
      .set("@store", resolve("src/store"))
      .set("@utils", resolve("src/utils"));
  },
  devServer: {
    port: 9000,
    open: true,
    proxy: {},
  },
  configureWebpack: {},
};
